#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <string.h>
int glob_val = 10;
int main()
{
  pid_t id = fork();
  if(id == 0)
  {
    int cnt = 0;
    while(1)
    {
      printf("child : pid:%d, ppid:%d, glob_val:%d,  &glob_val:%p\n",getpid(),getppid(),glob_val,&glob_val);
      sleep(1);
      ++cnt;
      if(cnt == 5)
      {
       glob_val = 20;
       printf("child change glob_val:10->20\n");
      }
    }
  }
  else
  {

    while(1)
    {
      printf("child : pid:%d, ppid:%d, glob_val:%d,  &glob_val:%p\n",getpid(),getppid(),glob_val,&glob_val);
      sleep(1);
     }
  }


  return 0;
}
